-- Mousepull2

function love.load()
  
  sheep = {
    x = 1,
    --y = 200,
    --width = 100,
    --height = 100,
    count = { active = false, current = 1, diffX = 0, targetX = 0}
  }
end

function love.update(dt)

	if sheep.count.targetX ~= sheep.count.current then
	
		-- do stuff
		local i = 0
		while i < sheep.count.targetX  do
		
		--love.graphics.print("test", 150,150)
		
		
		
		i = i + 1
		
		end
	
	end

end

function love.draw()
local e, f = love.mouse.getPosition()
--love.graphics.print("The mouse is at (" .. e .. "," .. f .. ")", 50, 50)
  --love.graphics.print("The box is at (" .. rect.x .. "," .. rect.y .. ")", 100, 100)
  --love.graphics.rectangle("fill", rect.x, rect.y, rect.width, rect.height)
  --love.graphics.print("Diffs are (" .. rect.move.diffX .. "," .. rect.move.diffY .. ")", 100, 140)
  --love.graphics.print("Targets are (" .. rect.move.targetX .. "," .. rect.move.targetY .. ")", 100, 160)
  love.graphics.print("Lets count some sheep. Marker is currently at " .. sheep.count.current .. ", target is " .. sheep.count.targetX .. ", Diff is " .. sheep.count.diffX .. ".", 50, 50)
end

function love.mousepressed(x, y, button)
	if button == "l" -- if left button is pressed
		then
		
		sheep.count.targetX = x
		sheep.count.diffX = x - sheep.count.current
		
		end
end

function love.mousereleased(x, y, button)
  if button == "l" then sheep.count.active = false end
end